<template>
    <div class="code">
        <div class="header"><img class="return_img" src="@/assets/Return.png" style="width:.23rem;height:.4rem;" v-on:click="back">微信授权</div>
        <div class="content">
            <div class="img">
                 <img  src="@/assets/code.png" alt="" style="width:1.12rem">
            </div>
            <p>请绑定微信，提现的金额，会直接转到您绑定的微信 红包中，请注意查收。</p>
        </div>
    </div>
</template>

<script>
import { getWechatInfo } from "@/service/home.js";
import { XButton } from "vux";
import { setTimeout } from 'timers';
export default {
  components: {
    XButton
  },
  data() {
    return {
      code: "111",
      token: sessionStorage.token,
      url: ""
    };
  },
  mounted() {
    this.get_url();
    this.add();
  },
  methods: {
    get_url() {
      this.code = this.$route.query.code;
      console.log(this.code);
    },
    back() {
      this.$router.push({ path: "/my/MyInformation" });
    },
    add() {
      this.code = this.$route.query.code;
      var data = {
        code: this.code
      };
      // this.$router.push({ path: "/my/MyInformation" });
      getWechatInfo(data).then(res => {
        // window.location.href = "http://staff.ihotelvip.com/my/MyInformation"        
        this.$router.push({ path: "/my/MyInformation" });
      });
    }
  }
};
</script>
<style  scoped lang="less">
.code {
  .content {
    height: 4rem;
    background: #fff;
    padding-top: 0.48rem;
    .img {
      width: 1.12rem;
      margin: 0 auto;
    }
    p {
      color: #999999;
      font-size: 0.3rem;
      text-align: center;
    }
  }
}
</style>
